<template>
    <div>
        <div class="mg-content">
          <el-row :gutter="20" class="p-b-15">
            <el-col :span="12" class="text-left p-l-20p"><span class="f-b">姓名：</span>{{member.name}}</el-col>
            <el-col :span="12" class="text-left"><span class="f-b">性别：</span><span v-if="member.gender">{{member.gender.text}}</span></el-col>
          </el-row>
          <el-row :gutter="20" class="p-b-15">
            <el-col :span="12" class="text-left p-l-20p"><span class="f-b">生日：</span><span>{{moment(member.birthday).format("YYYY-MM-DD")}}</span></el-col>
            <el-col :span="12" class="text-left"><span class="f-b">手机号：</span>{{member.phone}}</el-col>
          </el-row>
          <el-row :gutter="20" class="p-b-15">
            <el-col :span="12" class="text-left p-l-20p"><span class="f-b">入会时间：</span>{{member.createAt}}</el-col>
            <el-col :span="12" class="text-left"><span class="f-b">入会渠道：</span>{{member.source}}</el-col>
          </el-row>
          <el-row :gutter="20" class="p-b-15">
            <el-col :span="12" class="text-left p-l-20p"><span class="f-b">持卡情况：</span>{{member.count}}</el-col>
            <el-col :span="12" class="text-left"><span class="f-b">消费总额：</span>{{member.consumeAmount}}</el-col>
          </el-row>
          <el-row :gutter="20" class="p-b-15">
            <el-col :span="12" class="text-left p-l-20p"><span class="f-b">消费次数：</span>{{member.consumeCount}}</el-col>
            <el-col :span="12" class="text-left"><span class="f-b">最后消费时间：</span>{{member.consumeTime}}</el-col>
          </el-row>


        </div>


    </div>
</template>
<script>
    //注意路径
    export default{
        data(){
            return {
              id:'',
              member:{}
            }
        },
        created(){
            window.this = this;
            console.log("nnnn");
            console.log(this.$route.query.id);
            if(this.$route.query.id){
              this.id = this.$route.query.id;
              this.initData();
            }

        },
        methods: {
            initData(){
              this.$axios.get("members/members/"+this.id).then((data)=>{
                this.member = data.content;
              }).catch(function(err){
              })
            }
        }
    }
</script>
<style scoped>

</style>
